//#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "mission\addAction.sqf"
#include <tmf_constants.h>
#include <tmf_macros.h>

TRACE_1("Start",_this);
private ["_array","_param","_params","_target","_caller","_id","_action_timer_id","_action_timer"];
_target = _this select 0;
_caller = _this select 1;
_id = _this select 2;
_param = _this select 3;

// Disabling of double actions by introducing a delay
_action_timer_id = format["%1_%2",QGVAR(action_display_timer),_id];
_action_timer = OGETVAR(_target,_action_timer_id,0);
if (_action_timer > time) exitWith { TLOG("Too early for action"); };
OSETVAR(_target,_action_timer_id,time + 3);

// Disabling of the menu built into the condition
OSETVAR(_target,QGVAR(action_display_timer),time + 5);

_params = [_target, _caller, _id, _param];
[QGVAR(all_action), _params,THIS_FILE] call FFUNC(callEvent);